<div id="chart-legend-{{widget_pk}}-{{chart.pk}}" style="padding: 0px; position: relative; table-layout: fixed;">
    <div class="legendTitle">{{ chart.title }}</div>
    <div class="legend">
        <table id="chart-legend-table-{{widget_pk}}-{{chart.pk}}" class="tablesorter" style="font-size:smaller;color:#545454; width: 100%;table-layout: fixed;">
            <thead>
                <tr class="legendSeries">
                    <th style="width:14px;">
                        <input type="checkbox" checked="checked" id="chart-legend-checkbox-{{widget_pk}}-{{ chart.pk }}-make_all_none">
                    </th>
                    <th style="width:20px;" class="sorter-false"></th>
                    <th style="position: inherit;">
                        Mark All/None
                        <span id="chart-legend-options-span-{{widget_pk}}-{{chart.pk}}"></span>
                    </th>
                    <th style="width:45px; text-align:right"></th>
                    <th style="width:35px;"></th>
                    <th class="sorter-false" style="width:14px;">
                      <div class="dropdown" style="display: none;">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="chart-legend-options-{{widget_pk}}-{{chart.pk}}">
                            <span class="glyphicon glyphicon-cog" data-toggle="tooltip" data-placement="top" title="" data-original-title="Chart options" style="font-size:8px;vertical-align:text-top;"></span>
                        </a>
                        <ul class="dropdown-menu" style="min-width: 0px;font-size:11px;">
                            <li>Aggregation</li>
                            <li class="divider"></li>
                            <li>Type <select class="aggregation-all-option" id="aggregation-type-all-select-{{widget_pk}}-{{chart.pk}}" data-id="{{ var.id }}" data-widget-id="{{widget_pk}}-{{chart.pk}}" style="width:66px;">
                                <option value=null>None</option>
                            </select></li>
                            <li class="hidden" id="li-aggregation-all-period-select-{{widget_pk}}-{{chart.pk}}">Period <select class="aggregation-all-option" id="aggregation-all-period-select-{{widget_pk}}-{{chart.pk}}" data-id="{{ var.id }}" data-widget-id="{{widget_pk}}-{{chart.pk}}" style="width:66px;">
                                <option value=null>None</option>
                            </select></li>
                        </ul>
                      </div>
                    </th>
                </tr>
            </thead>
            <tbody>

            {% for axe in chart.chartaxis_set.all|dictsort:"id" %}
                {% include "_chart_legend.html" with axe=axe %}
            {% endfor %}
            {% if pie %}
                {% include "_chart_legend.html" with axe=chart %}
            {% endif %}
            </tbody>
        </table>
    </div>
</div>
